

    \filetitle{dat2str}{Convert IRIS dates to cell array of strings}{dates/dat2str}

	\paragraph{Syntax}

\begin{verbatim}
S = dat2str(Dat,...)
\end{verbatim}

\paragraph{Input arguments}

\begin{itemize}
\tightlist
\item
  \texttt{Dat} {[} numeric {]} - IRIS serial date number(s).
\end{itemize}

\paragraph{Output arguments}

\begin{itemize}
\tightlist
\item
  \texttt{S} {[} cellstr {]} - Cellstr with strings representing the
  input dates.
\end{itemize}

\paragraph{Options}

\begin{itemize}
\item
  \texttt{\textquotesingle{}dateFormat=\textquotesingle{}} {[} char
  \textbar{} cellstr \textbar{}
  \emph{\texttt{\textquotesingle{}YYYYFP\textquotesingle{}}} {]} - Date
  format string, or array of format strings (possibly different for each
  date).
\item
  \texttt{\textquotesingle{}freqLetters=\textquotesingle{}} {[} char
  \textbar{} \emph{\texttt{\textquotesingle{}YHQBMW\textquotesingle{}}}
  {]} - Six letters used to represent the six possible frequencies of
  IRIS dates, in this order: yearly, half-yearly, quarterly, bi-monthly,
  monthly, and weekly (such as the
  \texttt{\textquotesingle{}Q\textquotesingle{}} in
  \texttt{\textquotesingle{}2010Q1\textquotesingle{}}).
\item
  \texttt{\textquotesingle{}months=\textquotesingle{}} {[} cellstr
  \textbar{}
  \emph{\texttt{\{\textquotesingle{}January\textquotesingle{},...,\textquotesingle{}December\textquotesingle{}\}}}
  {]} - Twelve strings representing the names of the twelve months.
\item
  \texttt{\textquotesingle{}standinMonth=\textquotesingle{}} {[} numeric
  \textbar{} \texttt{\textquotesingle{}last\textquotesingle{}}
  \textbar{} \emph{\texttt{1}} {]} - Month that will represent a
  lower-than-monthly-frequency date if the month is part of the date
  format string.
\item
  \texttt{\textquotesingle{}wwDay=\textquotesingle{}} {[}
  \texttt{\textquotesingle{}Mon\textquotesingle{}} \textbar{}
  \texttt{\textquotesingle{}Tue\textquotesingle{}} \textbar{}
  \texttt{\textquotesingle{}Wed\textquotesingle{}} \textbar{}
  \emph{\texttt{\textquotesingle{}Thu\textquotesingle{}}} \textbar{}
  \texttt{\textquotesingle{}Fri\textquotesingle{}} \textbar{}
  \texttt{\textquotesingle{}Sat\textquotesingle{}} \textbar{}
  \texttt{\textquotesingle{}Sun\textquotesingle{}} {]} - Day of week
  that will represent weeks.
\end{itemize}

\paragraph{Description}

There are two types of date strings in IRIS: year-period strings and
calendar date strings. The year-period strings can be printed for dates
with yearly, half-yearly, quarterly, bimonthly, monthly, weekly, and
indeterminate frequencies. The calendar date strings can be printed for
dates with weekly and daily frequencies. Date formats for calendar date
strings must start with a dollar sign, \texttt{\$}.

\subparagraph{Year-period date strings}

Regular date formats can include any combination of the following
fields:

\begin{itemize}
\item
  \texttt{\textquotesingle{}Y\textquotesingle{}} - Year.
\item
  \texttt{\textquotesingle{}YYYY\textquotesingle{}} - Four-digit year.
\item
  \texttt{\textquotesingle{}YY\textquotesingle{}} - Two-digit year.
\item
  \texttt{\textquotesingle{}P\textquotesingle{}} - Period within the
  year (half-year, quarter, bi-month, month, week).
\item
  \texttt{\textquotesingle{}PP\textquotesingle{}} - Two-digit period
  within the year.
\item
  \texttt{\textquotesingle{}R\textquotesingle{}} - Upper-case roman
  numeral for the period within the year.
\item
  \texttt{\textquotesingle{}r\textquotesingle{}} - Lower-case roman
  numeral for the period within the year.
\item
  \texttt{\textquotesingle{}M\textquotesingle{}} - Month numeral.
\item
  \texttt{\textquotesingle{}MM\textquotesingle{}} - Two-digit month
  numeral.
\item
  \texttt{\textquotesingle{}MMMM\textquotesingle{}},
  \texttt{\textquotesingle{}Mmmm\textquotesingle{}},
  \texttt{\textquotesingle{}mmmm\textquotesingle{}} - Case-sensitive
  name of month.
\item
  \texttt{\textquotesingle{}MMM\textquotesingle{}},
  \texttt{\textquotesingle{}Mmm\textquotesingle{}},
  \texttt{\textquotesingle{}mmm\textquotesingle{}} - Case-sensitive
  three-letter abbreviation of month.
\item
  \texttt{\textquotesingle{}Q\textquotesingle{}} - Upper-case roman
  numeral for the month or stand-in month.
\item
  \texttt{\textquotesingle{}q\textquotesingle{}} - Lower-case roman
  numeral for the month or stand-in month.
\item
  \texttt{\textquotesingle{}F\textquotesingle{}} - Upper-case letter
  representing the date frequency.
\item
  \texttt{\textquotesingle{}f\textquotesingle{}} - Lower-case letter
  representing the date frequency.
\item
  \texttt{\textquotesingle{}EE\textquotesingle{}} - Two-digit
  end-of-month day; stand-in month used for non-monthly dates.
\item
  \texttt{\textquotesingle{}E\textquotesingle{}} - End-of-month day;
  stand-in month used for non-monthly dates.
\item
  \texttt{\textquotesingle{}WW\textquotesingle{}} - Two-digit
  end-of-month workday; stand-in month used for non-monthly dates.
\item
  \texttt{\textquotesingle{}W\textquotesingle{}} - End-of-month workday;
  stand-in month used for non-monthly dates.
\end{itemize}

\subparagraph{Calendar date strings}

Calendar date formats must start with a dollar sign, \texttt{\$}, and
can include any combination of the following fields:

\begin{itemize}
\item
  \texttt{\textquotesingle{}Y\textquotesingle{}} - Year.
\item
  \texttt{\textquotesingle{}YYYY\textquotesingle{}} - Four-digit year.
\item
  \texttt{\textquotesingle{}YY\textquotesingle{}} - Two-digit year.
\item
  \texttt{\textquotesingle{}DD\textquotesingle{}} - Two-digit day
  numeral; daily and weekly dates only.
\item
  \texttt{\textquotesingle{}D\textquotesingle{}} - Day numeral; daily
  and weekly dates only.
\item
  \texttt{\textquotesingle{}M\textquotesingle{}} - Month numeral.
\item
  \texttt{\textquotesingle{}MM\textquotesingle{}} - Two-digit month
  numeral.
\item
  \texttt{\textquotesingle{}MMMM\textquotesingle{}},
  \texttt{\textquotesingle{}Mmmm\textquotesingle{}},
  \texttt{\textquotesingle{}mmmm\textquotesingle{}} - Case-sensitive
  name of month.
\item
  \texttt{\textquotesingle{}MMM\textquotesingle{}},
  \texttt{\textquotesingle{}Mmm\textquotesingle{}},
  \texttt{\textquotesingle{}mmm\textquotesingle{}} - Case-sensitive
  three-letter abbreviation of month.
\item
  \texttt{\textquotesingle{}Q\textquotesingle{}} - Upper-case roman
  numeral for the month.
\item
  \texttt{\textquotesingle{}q\textquotesingle{}} - Lower-case roman
  numeral for the month.
\item
  \texttt{\textquotesingle{}DD\textquotesingle{}} - Two-digit day
  numeral.
\item
  \texttt{\textquotesingle{}D\textquotesingle{}} - Day numeral.
\item
  \texttt{\textquotesingle{}Aaa\textquotesingle{}},
  \texttt{\textquotesingle{}AAA\textquotesingle{}} - Three-letter
  English name of the day of week
  (\texttt{\textquotesingle{}Mon\textquotesingle{}}, \ldots{},
  \texttt{\textquotesingle{}Sun\textquotesingle{}}).
\end{itemize}

\subparagraph{Escaping control letters}

To get the format letters printed literally in the date string, use a
percent sign as an escape character:
\texttt{\textquotesingle{}\%Y\textquotesingle{}},
\texttt{\textquotesingle{}\%P\textquotesingle{}},
\texttt{\textquotesingle{}\%F\textquotesingle{}},
\texttt{\textquotesingle{}\%f\textquotesingle{}},
\texttt{\textquotesingle{}\%M\textquotesingle{}},
\texttt{\textquotesingle{}\%m\textquotesingle{}},
\texttt{\textquotesingle{}\%R\textquotesingle{}},
\texttt{\textquotesingle{}\%r\textquotesingle{}},
\texttt{\textquotesingle{}\%Q\textquotesingle{}},
\texttt{\textquotesingle{}\%q\textquotesingle{}},
\texttt{\textquotesingle{}\%D\textquotesingle{}},
\texttt{\textquotesingle{}\%E\textquotesingle{}},
\texttt{\textquotesingle{}\%D\textquotesingle{}}.

\paragraph{Example}


